<template>
    <el-form :model="vipprice" label-width="120px">
        <el-form-item label="黄金会员：">
            <el-input @change="setGold" v-model="vipprice[0].memberPrice" />
        </el-form-item>
    </el-form>
    <el-form :model="vipprice" label-width="120px">
        <el-form-item label="白金会员：">
            <el-input @change="setPlatinum" v-model="vipprice[1].memberPrice" />
        </el-form-item>
    </el-form>
    <el-form :model="vipprice" label-width="120px">
        <el-form-item label="钻石会员：">
            <el-input @change="setDiamond" v-model="vipprice[2].memberPrice" />
        </el-form-item>
    </el-form>
</template>

<script setup lang="ts">
import { reactive } from 'vue';

const vipprice = reactive([
    { memberLevelId: 1, memberLevelName: "黄金会员", memberPrice: "" },
    { memberLevelId: 2, memberLevelName: "白金会员", memberPrice: "" },
    { memberLevelId: 3, memberLevelName: "钻石会员", memberPrice: "" }
])

const emits = defineEmits<{
    (event: string, value: vipprice): void
}>()

const setGold = () => {
    emits("getGold", vipprice[0])
}

const setPlatinum = () => {
    emits("getPlatinum", vipprice[1])
}

const setDiamond = () => {
    emits("getDiamond", vipprice[2])
}

</script>

<style lang="less" scoped>
.el-form-item {
    margin-top: 10px;
}
</style>